//
//  UIButton+Style.m
//  GTG
//
//  Created by xieyingze on 16/7/8.
//  Copyright © 2016年 xieyingze. All rights reserved.
//

#define kCOLOR_DisableBackgroundColor     [UIColor grayColor]
#define kCOLOR_DefaultBackgroundColor     [UIColor whiteColor]

#define kCOLOR_DisableTitleColor     [UIColor grayColor]
#define kCOLOR_DefaultTitleColor     [UIColor whiteColor]

#import "UIButton+Style.h"
#import "ColorDefine.h"

@implementation UIButton (Style)

- (void)setDisableStyle {
    self.layer.cornerRadius = 20.f;
    self.layer.masksToBounds = YES;
    self.backgroundColor = kCOLOR_RGBValue(0xe1e1e1);
    [self setTitleColor:kCOLOR_white forState:UIControlStateNormal];
    self.enabled = NO;
}

- (void)setDefaultStyle {
    self.layer.cornerRadius = 20.f;
    self.layer.masksToBounds = YES;
    self.backgroundColor = kCOLOR_tabBar;
    [self setTitleColor:kCOLOR_white forState:UIControlStateNormal];
    self.enabled = YES;
}

- (void)setButtonStyle:(NSString *)title titleColor:(UIColor *)titleColor titleFont:(UIFont *)titleFont texrAlignment:(NSTextAlignment)titleAlignment {
    [self setTitle:title forState:UIControlStateNormal];
    [self setTitleColor:titleColor forState:UIControlStateNormal];
    self.titleLabel.font = titleFont;
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

- (void)setSendVerifyBeginStyle {
    self.enabled = NO;
    self.backgroundColor = kCOLOR_tableView;
    [self setTitleColor:kCOLOR_tabBar forState:UIControlStateNormal];
}

- (void)setSendVerifyEndStyle {
    self.enabled = YES;
    self.backgroundColor = kCOLOR_tabBar;
    [self setTitleColor:kCOLOR_tableView forState:UIControlStateNormal];
}

@end
